using System;
using System.Data;
using System.Collections;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SiteECSWeb;
/// <summary>
/// Summary description for LogActivityInfo
/// </summary>
namespace SiteECSWeb
{
    public class LogActivityInfo : IComparer
    {
        public LogActivityInfo(string tablename, string columnname, 
            object pkcolumn, object oldvalue, object newvalue)
        {
            _tableName = tablename;
            _columnName = columnname;
            _pkColumn = pkcolumn;
            _oldValue = oldvalue;
            _newValue = newvalue;
        }
        private string _tableName;

        public string TableName
        {
            get { return _tableName; }
            set { _tableName = value; }
        }
        private string _columnName;

        public string ColumnName
        {
            get { return _columnName; }
            set { _columnName = value; }
        }

        private object _pkColumn;

        public object PKColumn
        {
            get { return _pkColumn; }
            set { _pkColumn = value; }
        }
        private object _oldValue;

        public object OldValue
        {
            get { return _oldValue; }
            set { _oldValue = value; }
        }

        private object _newValue;

        public object NewValue
        {
            get { return _newValue; }
            set { _newValue = value; }
        }

        #region IComparer Members
        /// <summary>
        /// Compare the objects in this class, if the two objects are equal return 0, otherwise -1
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public int Compare(object x, object y)
        {
            if (x != null && y != null)
            {
                if (x.Equals(y))
                {
                    return 0;
                }
                else
                {
                    return -1;
                }
            }
            else if ((x == null && y != null) || (x != null && y == null))
            {
                return -1;
            }
            else
            {
                return 0;
            }
        }
        #endregion
    }
}

